package lab02.Test21;

public class Test {
        int Test(String s,char c){
            int test=0;
            for(int i=0;i<s.length();i++){
                if(s.charAt(i)==c){
                    test++;
                }
            }
            return test;
        }
        public static void main(String args[]){
            System.out.println("输入字符窜为:LOVELOVEYOU");
            System.out.println("字符O出现的频率:"+new Test().Test("LOVELOVEYOU",'O'));
        }
    }


